/**
  ******************************************************************************
  * @file 	MT9D111_stm_driver.h 
  * @brief  Headers for unit Tests
  ******************************************************************************
  */
#ifndef __MT9D111_H
#define __MT9D111_H

#include "main.h"



// status up to 16, bottom half of status var
#define STAT_STARTUP 	0x1
#define STAT_STARTED	STAT_STARTUP*2

// packet type 
#define PACKET_INFO		0x00
#define PACKET_DATA		0x01

// #define true							!false
// #define false							0

// extern vars


// vars
extern u32 pwmTicks;
extern __IO uint32_t TimingDelay;
extern unsigned long pa0Ticks;
//extern u32 status;
extern float CCP2FQ;
static u8 txing;
//extern unsigned long DMATicks; // todo remove from extern
//extern float DMAFQ;

// function defines 
u8 testUnit(u8 unitNum);		// test unit #, returns error code

void initSystems(void);
void initCCP1(void);			// setup the compare capture for reading pclk
void initCCP2(void);			// capture compare for reading fq of other lines
void initPWM(float frequency);	// setup the pulse width modulation output
void initDMA1(void);			// setup DMA portE tx to memory buffer 
void initDMA2(void);			// setup DMA for usart tx of data
void NVIC_Configuration(void);	// setup interupts
void TIM1_UP_IRQHandler(void);	// int for timer1 update

void initLed(void);				// led gpio setup
void initEXTI(void);			// int external int on toggle line
void USART1_Config(void); 
void USART3_Config(void);		// debug output


void setLeds(u8 value);


#endif
